package com.study.mythread.juc;

/**
 * @program: java-study-of-learner
 * @description: 简单的线程实现
 * @author: future
 * @create: 2021-01-16 17:58
 **/
public class MyDemo1 {
    //NEW
    //RUNNABLE
    //BLOCKED
    //WAITING
    //TIMED_WAITING
    //TERMINATED
    public static void main(String[] args) {
        System.out.println(Runtime.getRuntime().availableProcessors());
        Thread thread = new Thread(() -> {
            int xx = 0;
            for (; ; ) {
                xx++;
                System.out.println(xx);
                System.out.println("================");
                if (xx > 20) {
                    break;
                }
            }
        });
        Thread.State[] li = Thread.State.values();
        for (int i = 0; i < li.length; i++) {
            System.out.println(li[i]);
            Object ob = new Object();

        }

        System.out.println(thread.getState() + "@@@@@@@@@@@@@@@@@@@@");
        thread.start();
        System.out.println(thread.getState() + "@@@@@@@@@@@@@@@@@@@@");
    }
}
